<template>
  <div ref="border3" class="border-wrap">
    <svg class="dv-border-svg-container" :width="width" :height="height">
      <polygon
        :fill="bgColor"
        :points="`
        23, 23 ${width - 24}, 23 ${width - 24}, ${height - 24} 23, ${height - 24}
      `"
      />

      <polyline class="dv-bb3-line1" :stroke="borderColor[0]" :points="`4, 4 ${width - 22} ,4 ${width - 22}, ${height - 22} 4, ${height - 22} 4, 4`" />
      <polyline class="dv-bb3-line2" :stroke="borderColor[1] || borderColor[1]" :points="`10, 10 ${width - 16}, 10 ${width - 16}, ${height - 16} 10, ${height - 16} 10, 10`" />
      <polyline class="dv-bb3-line2" :stroke="borderColor[2] || borderColor[1]" :points="`16, 16 ${width - 10}, 16 ${width - 10}, ${height - 10} 16, ${height - 10} 16, 16`" />
      <polyline class="dv-bb3-line2" :stroke="borderColor[3] || borderColor[1]" :points="`22, 22 ${width - 4}, 22 ${width - 4}, ${height - 4} 22, ${height - 4} 22, 22`" />
    </svg>
  </div>
</template>

<script>

export default {
  props: {
    bgColor: {
      type: String,
      default: () => 'transparent'
    },
    borderColor: {
      type: Array,
      default: () => ['#2862b7', '#2862b7', '#2862b7', '#2862b7']
    },
    width: {
      type: Number,
      default: () => 0
    },
    height: {
      type: Number,
      default: () => 0
    }
  }
}
</script>

<style scoped="scoped" lang="less">
  .dv-border-svg-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;

    polyline {
      fill: none;
    }
  }

  .dv-bb3-line1 {
    stroke-width: 3;
  }

  .dv-bb3-line2 {
    stroke-width: 1;
  }
</style>
